<p id="notice"><%= notice %></p>

<div class="row">
	<div class="col-xs-12 col-md-12">
		<!-- widgets part -->
		<div class="widget">
			<div class="widget-header bordered-bottom bordered-themeprimary">
				<i class="widget-icon fa fa-tasks themeprimary"></i>
				<span class="widget-caption themeprimary"><%=@warehouse.name %></span>



        <div class="widget-buttons buttons-bordered">
          <%= button_to '添加产品', new_product_path(@warehouse), method: :get,warehouse_id: @warehouse.id, :class => "btn btn-blue btn-xs" %>
        </div>

				<div class="widget-buttons buttons-bordered">
					<%= button_to '编辑', edit_warehouse_path(@warehouse), method: :get, :class => "btn btn-blue btn-xs" %>
				</div>
				<div class="widget-buttons buttons-bordered">
					<%= button_to '返回', warehouses_path, method: :get, :class => "btn btn-blue btn-xs" %>
				</div>
			</div><!--Widget Header-->
			<div class="widget-body">
				<div class="widget-main no-padding">
					<div class="flip-scroll">
						<div class="dataTables_wrapper form-inline no-footer">
							<table class="table table-bordered table-striped table-condensed flip-content">
								<thead class="flip-content bordered-palegreen">
									<tr>
										<th>仓库</th>
										<th>物料编码</th>
										<th>产品名称</th>
										<th>规格型号</th>
										<th>单位</th>
										<th>数量</th>
										<th colspan="3"></th>
									</tr>
								</thead>

								<tbody>
									<% @products.each do |product| %>
									<tr>
										<td><%= product.warehouse.name %></td>
										<td><%= product.pn %></td>
										<td><%= product.name %></td>
										<td><%= product.desc %></td>
										<td><%= product.unit %></td>
										<td><%= product.quantity %></td>
										<td> <%= link_to image_tag('show.png'), product %>
										<%= link_to image_tag('edit.gif'), edit_product_path(product) %>
										<%= link_to image_tag('trash.gif'), product, method: :delete, data: { confirm: 'Are you sure?' } %> </td>
									</tr>
									<% end %>
								</tbody>

							</table>
							<div class="row DTTTFooter">
								<div class="col-xs-12 col-md-12">
									<div class="dataTables_paginate paging_bootstrap" id="simpledatatable_paginate">
										<%= paginate @products, window: 1, outer_window: 1, remote: true %>
									</div>
								</div>
							</div>

						</div>
					</div>

				</div><!--Widget Main Container-->
			</div><!--Widget Body-->
		</div>


		<!-- end of widgets part -->
	</div>
</div>

